//
//  addClubController.m
//  PaiQuan
//
//  Created by Mac on 16/7/11.
//  Copyright © 2016年 huigu. All rights reserved.
//

#import "addClubController.h"

@interface addClubController ()

@end

@implementation addClubController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUPNav];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)setUPNav{
     self.titleView.title = @" 加入俱乐部";
    [self.titleView.btnBack setImage:PQIMG(@"back") forState:UIControlStateNormal];
    [self.titleView.btnBack setTitle:@"返回" forState:UIControlStateNormal];
    [self.titleView.btnBack setTitleColor:PQ_COLOR_YELLOW forState:UIControlStateNormal];
    
    
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    if (section == 0) {
        
        
        UIView *headerView = [[UIView alloc] init];
        headerView.backgroundColor = PQ_COLOR_DarkGray;
        
        UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(10, 10, ScreenW - 20, 40)];
        searchBar.backgroundColor =[UIColor whiteColor ];
        
        //    searchBar.tintColor =[UIColor whiteColor];
        //    searchBar.searchBarStyle =UISearchBarStyleMinimal;
        searchBar.backgroundImage = [UIImage imageWithColor:PQ_COLOR_DarkGray frame:searchBar.frame];
        searchBar.placeholder = @"俱乐部名／俱乐部号";
        [headerView addSubview:searchBar];
        UILabel *hotClubLab = [[UILabel alloc] init];
        [hotClubLab setFont:FONT(14)];
        [hotClubLab setText:@"热门俱乐部"];
        [hotClubLab setTextColor:PQ_COLOR_YELLOW];
        [headerView addSubview:hotClubLab];
        [hotClubLab makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(headerView);
            make.bottom.equalTo(headerView.bottom).offset(-RATIO(10));
        }];
        
        return headerView;
    }
    return nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    if(section == 0){
        return RATIO(144);
    }else{
        return RATIO(12);
    }
    
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 1;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 4;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *ID =@"id";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell ==nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        cell.imageView.image = PQIMG(@"05_normal");
        cell.textLabel.text = @"俱乐部成员";
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.backgroundColor = PQ_COLOR_LightGray;
        
    }
    return cell;
    
    
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
